home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib7 / v_09_02 / 9n02098c < prev    next >
Encoding:
Text File  |  1995-11-01  |  248 b   |  19 lines

  1.  
  2.  
  3. SYMBOL *savesym(SYMBOL *s)
  4. {
  5. int size;
  6. SYMBOL *p;
  7.  
  8. size = sizeof(SYMBOL) + strlen(s->symbol);
  9. #ifdef LHEAP
  10. p = sbrk(size);
  11. if(p == (void *)(-1)) return(NULL);
  12. #else
  13. p = malloc(size);
  14. #endif
  15. if(p) memcpy(p,s,size);
  16. return(p);
  17. }
  18.  
  19.